import { InputType, StrategyKey, generateRandomId } from '@/utils';

export const editConfig: PageConfig = {
    items: [
        {
            itemType: 'text',
            modelKey: 'customerCode',
            elInputProps: {
                placeholder: '请输入客户编码',
                disabled: true,
                maxlength: '50',
                showWordLimit: true
            },
            columnProps: {
                label: '客户编码'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        },
        {
            itemType: 'text',
            modelKey: 'customerCompanyName',
            elInputProps: {
                placeholder: '请输入客户公司名称',
                maxlength: '50',
                showWordLimit: true
            },
            columnProps: {
                label: '客户公司名称'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            itemType: 'select',
            modelKey: 'customerPriority',
            elSelectProps: {
                placeholder: '请选择客户优先级',
                options: [
                    {
                        label: '1',
                        value: '1'
                    },
                    {
                        label: '2',
                        value: '2'
                    },
                    {
                        label: '3',
                        value: '3'
                    },
                    {
                        label: '4',
                        value: '4'
                    },
                    {
                        label: '5',
                        value: '5'
                    }
                ]
            },
            columnProps: {
                label: '客户优先级'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            itemType: 'text',
            modelKey: 'customerName',
            elInputProps: {
                placeholder: '请输入客户姓名',
                maxlength: '50',
                showWordLimit: true
            },
            columnProps: {
                label: '客户姓名'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            itemType: 'text',
            modelKey: 'customerPhone',
            elInputProps: {
                placeholder: '请输入客户电话',
                maxlength: '20',
                showWordLimit: true
            },
            columnProps: {
                label: '客户电话'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            validRules: [
                {
                    validType: StrategyKey.IS_MOBILE_OR_TELEPHONE,
                    errMsg: '电话号码格式不正确'
                }
            ],
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        }
    ]
};
